<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function addZero(n) {
      return n < 10 ? '0' + n : n;
    }
    let t1 = '2021-01-17T03:47:22.000Z';
    let t2 = 1362342392983;

    // 1. 实例化 Date 对象
    // let date = new Date(t1);
    let date = new Date(t1);
    // console.log(date);
    let y = date.getFullYear();
    let m = addZero(date.getMonth() + 1);
    let d = addZero(date.getDate());
    let h = addZero(date.getHours());
    let i = addZero(date.getMinutes());
    let s = addZero(date.getSeconds());

    console.log(y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s)
  </script>
</body>

</html>